const Router = require('koa-router');
const { queryByAI } = require('../controllers/aiQueryController');
const { mockData } = require('../utils/mockdata');
const router = new Router({ prefix: '/ai' });
const { startRecording, stopRecording } = require('../utils/fvoice');
router.post('/query', queryByAI);

router.get('/mockdata', async (ctx, next) => {
    await mockData();
    ctx.body = {
        code: 200,
        msg: 'success',
        data: {}
    }
});

router.post('/start', async (ctx, next) => {
    startRecording();
    ctx.body = {
        code: 200,
        msg: 'success',
        data: {}
    }
});

router.post('/stop', async (ctx, next) => {
    stopRecording();
    ctx.body = {
        code: 200,
        msg: 'success',
        data: {}
    }
})


module.exports = router;
